close all;clc;clear all;

f = [0 1 2.5 2.5 3 3.5 4 4 5 6 6 6.5 7 7.5 7.5 8 9];
m = [1 1 1 2 2.5 2 2   3 6 3 2   2 2.5 2 1 1 1];

f = f/max(f);

figure(1)
plot(f,m);

n =50;
[b, a] = yulewalk(n, f, m);
[H, w] = freqz(b, a);
figure(1); plot(f, m, w/pi, abs(H));
xlabel('f/f_n'); 
ylabel('|H|');
ylim([0 11]); grid on; 
legend('Ideal','Designed')